import request from '@/utils/request'

// 查询车辆借调列表
export function listSecondment(query) {
  return request({
    url: '/car/secondment/list',
    method: 'get',
    params: query
  })
}

// 查询车辆借调详细
export function getSecondment(id) {
  return request({
    url: '/car/secondment/' + id,
    method: 'get'
  })
}
// 查询车辆借调详细
export function getInfoBycarId(carId) {
  return request({
    url: '/car/secondment/getInfoBycarId/' + carId,
    method: 'get'
  })
}

// 车辆借调预检
export function secondmentPreInspection(data) {
  return request({
    url: '/car/secondment/secondmentPreInspection',
    method: 'post',
    data: data
  })
}


// 新增车辆借调
export function addSecondment(data) {
  return request({
    url: '/car/secondment',
    method: 'post',
    data: data
  })
}

// 修改车辆借调
export function updateSecondment(data) {
  return request({
    url: '/car/secondment',
    method: 'put',
    data: data
  })
}

// 结束车辆借调
export function overSecondment(data) {
  return request({
    url: '/car/secondment/over',
    method: 'put',
    data: data
  })
}
// 删除车辆借调
export function delSecondment(id) {
  return request({
    url: '/car/secondment/' + id,
    method: 'delete'
  })
}

// 导出车辆借调
export function exportSecondment(query) {
  return request({
    url: '/car/secondment/export',
    method: 'get',
    params: query
  })
}
